/*
 * map集合
 * */
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;

public class MapTest {
    public static void main(String[] args) {
        Map<String,String> map = new HashMap<String,String>();
        map.put("a","aaa");
        map.put("b","bbb");
        System.out.println(map.get("a"));
        Iterator<String> it=map.keySet().iterator();
        while (it.hasNext()) {
            String key = it.next();
            String value = map.get(key);
            System.out.println(key + "," + value);
        }
        Set<Map.Entry<String,String>> es = map.entrySet();
        Iterator<Map.Entry<String,String>> ite = es.iterator();
        while (ite.hasNext()) {
            Map.Entry<String,String> men = ite.next();
            String key1 = men.getKey();
            String value1 = men.getValue();
            System.out.println(key1 + "," + value1);
        }
    }
}
